﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.TecajValute"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class TecajValuteEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ID property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxID;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ID property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDLabel;
		
		/// <summary>
		/// ComboBox for the IDValuta property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDValuta;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDValuta property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDValutaLabel;
		
		/// <summary>
		/// TextBox for the Srednji property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxSrednji;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Srednji property.
		/// </summary>
		protected System.Windows.Forms.Label uxSrednjiLabel;
		
		/// <summary>
		/// TextBox for the Kupovni property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxKupovni;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Kupovni property.
		/// </summary>
		protected System.Windows.Forms.Label uxKupovniLabel;
		
		/// <summary>
		/// TextBox for the Prodajni property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxProdajni;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Prodajni property.
		/// </summary>
		protected System.Windows.Forms.Label uxProdajniLabel;
		
		/// <summary>
		/// DataTimePicker for the DatumObjave property.
		/// </summary>
		protected System.Windows.Forms.DateTimePicker uxDatumObjave;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the DatumObjave property.
		/// </summary>
		protected System.Windows.Forms.Label uxDatumObjaveLabel;
		
		/// <summary>
		/// ComboBox for the IDBanka property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDBanka;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDBanka property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDBankaLabel;
		
		/// <summary>
		/// DataTimePicker for the DatumPrimjene property.
		/// </summary>
		protected System.Windows.Forms.DateTimePicker uxDatumPrimjene;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the DatumPrimjene property.
		/// </summary>
		protected System.Windows.Forms.Label uxDatumPrimjeneLabel;
		#endregion
		
		#region Main entity
		private Entities.TecajValute _TecajValute;
		/// <summary>
		/// Gets or sets the <see cref="Entities.TecajValute"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.TecajValute"/> instance.</value>
		public Entities.TecajValute TecajValute
		{
			get {return this._TecajValute;}
			set
			{
				this._TecajValute = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxID.DataBindings.Clear();
			this.uxID.DataBindings.Add("Text", this.uxBindingSource, "ID", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDValuta.DataBindings.Clear();
			this.uxIDValuta.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDValuta", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxSrednji.DataBindings.Clear();
			this.uxSrednji.DataBindings.Add("Text", this.uxBindingSource, "Srednji", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKupovni.DataBindings.Clear();
			this.uxKupovni.DataBindings.Add("Text", this.uxBindingSource, "Kupovni", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxProdajni.DataBindings.Clear();
			this.uxProdajni.DataBindings.Add("Text", this.uxBindingSource, "Prodajni", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxDatumObjave.DataBindings.Clear();
			this.uxDatumObjave.DataBindings.Add("Value", this.uxBindingSource, "DatumObjave", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDBanka.DataBindings.Clear();
			this.uxIDBanka.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDBanka", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxDatumPrimjene.DataBindings.Clear();
			this.uxDatumPrimjene.DataBindings.Add("Value", this.uxBindingSource, "DatumPrimjene", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="TecajValuteEditControlBase"/> class.
		/// </summary>
		public TecajValuteEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_TecajValute != null) _TecajValute.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxID = new System.Windows.Forms.TextBox();
			uxIDLabel = new System.Windows.Forms.Label();
			this.uxIDValuta = new System.Windows.Forms.ComboBox();
			uxIDValutaLabel = new System.Windows.Forms.Label();
			this.uxSrednji = new System.Windows.Forms.TextBox();
			uxSrednjiLabel = new System.Windows.Forms.Label();
			this.uxKupovni = new System.Windows.Forms.TextBox();
			uxKupovniLabel = new System.Windows.Forms.Label();
			this.uxProdajni = new System.Windows.Forms.TextBox();
			uxProdajniLabel = new System.Windows.Forms.Label();
			this.uxDatumObjave = new System.Windows.Forms.DateTimePicker();
			uxDatumObjaveLabel = new System.Windows.Forms.Label();
			this.uxIDBanka = new System.Windows.Forms.ComboBox();
			uxIDBankaLabel = new System.Windows.Forms.Label();
			this.uxDatumPrimjene = new System.Windows.Forms.DateTimePicker();
			uxDatumPrimjeneLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDLabel
			//
			this.uxIDLabel.Text = "ID:";
			this.uxIDLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDLabel);			
			//
			// uxID
			//
			this.uxID.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxID);
			this.uxID.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxID);
			//
			// uxIDValutaLabel
			//
			this.uxIDValutaLabel.Text = "IDValuta:";
			this.uxIDValutaLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxIDValutaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDValutaLabel);			
			//
			// uxIDValuta
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDValuta);
			this.uxIDValuta.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxIDValuta);
			//
			// uxSrednjiLabel
			//
			this.uxSrednjiLabel.Text = "Srednji:";
			this.uxSrednjiLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxSrednjiLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxSrednjiLabel);			
			//
			// uxSrednji
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxSrednji);
			this.uxSrednji.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxSrednji);
			//
			// uxKupovniLabel
			//
			this.uxKupovniLabel.Text = "Kupovni:";
			this.uxKupovniLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxKupovniLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKupovniLabel);			
			//
			// uxKupovni
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxKupovni);
			this.uxKupovni.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxKupovni);
			//
			// uxProdajniLabel
			//
			this.uxProdajniLabel.Text = "Prodajni:";
			this.uxProdajniLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxProdajniLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxProdajniLabel);			
			//
			// uxProdajni
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxProdajni);
			this.uxProdajni.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxProdajni);
			//
			// uxDatumObjaveLabel
			//
			this.uxDatumObjaveLabel.Text = "DatumObjave:";
			this.uxDatumObjaveLabel.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxDatumObjaveLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDatumObjaveLabel);			
			//
			// uxDatumObjave
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxDatumObjave);
			this.uxDatumObjave.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxDatumObjave);
			//
			// uxIDBankaLabel
			//
			this.uxIDBankaLabel.Text = "IDBanka:";
			this.uxIDBankaLabel.Location = new System.Drawing.Point(3, 156);
			this.Controls.Add(this.uxIDBankaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDBankaLabel);			
			//
			// uxIDBanka
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDBanka);
			this.uxIDBanka.Location = new System.Drawing.Point(160, 156);
			this.Controls.Add(this.uxIDBanka);
			//
			// uxDatumPrimjeneLabel
			//
			this.uxDatumPrimjeneLabel.Text = "DatumPrimjene:";
			this.uxDatumPrimjeneLabel.Location = new System.Drawing.Point(3, 182);
			this.Controls.Add(this.uxDatumPrimjeneLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDatumPrimjeneLabel);			
			//
			// uxDatumPrimjene
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxDatumPrimjene);
			this.uxDatumPrimjene.Location = new System.Drawing.Point(160, 182);
			this.Controls.Add(this.uxDatumPrimjene);
			//
			// uxIDBanka
			//				
			this.uxIDBanka.DisplayMember = "Naziv";	
			this.uxIDBanka.ValueMember = "ID";	
			//
			// uxIDValuta
			//				
			this.uxIDValuta.DisplayMember = "Naziv";	
			this.uxIDValuta.ValueMember = "ID";	
			// 
			// TecajValuteEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "TecajValuteEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.Banka> _IDBankaList;
		
		/// <summary>
		/// The ComboBox associated with the IDBanka property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Banka> IDBankaList
		{
			get {return _IDBankaList;}
			set 
			{
				this._IDBankaList = value;
				this.uxIDBanka.DataSource = null;
				this.uxIDBanka.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDBankaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDBanka property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDBankaList
		{
			get { return _allowNewItemInIDBankaList;}
			set
			{
				this._allowNewItemInIDBankaList = value;
				this.uxIDBanka.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.Valuta> _IDValutaList;
		
		/// <summary>
		/// The ComboBox associated with the IDValuta property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Valuta> IDValutaList
		{
			get {return _IDValutaList;}
			set 
			{
				this._IDValutaList = value;
				this.uxIDValuta.DataSource = null;
				this.uxIDValuta.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDValutaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDValuta property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDValutaList
		{
			get { return _allowNewItemInIDValutaList;}
			set
			{
				this._allowNewItemInIDValutaList = value;
				this.uxIDValuta.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
